import request from '@/utils/request'

// 查询合同编制列表
export function listHtbz(query) {
  return request({
    url: '/htbz/htbz/list',
    method: 'get',
    params: query
  })
}

// 查询合同编制详细
export function getHtbz(htbzId) {
  return request({
    url: '/htbz/htbz/' + htbzId,
    method: 'get'
  })
}

// 新增合同编制
export function addHtbz(data) {
  return request({
    url: '/htbz/htbz',
    method: 'post',
    data: data
  })
}

// 新增附件
export function insertHtFjByHtBzId(data) {
  return request({
    url: '/htbz/htbz/add/File/By/subId',
    method: 'post',
    data: data
  })
}

// 根据主表ID查询附件列表
export function selectHtBzFjList(htbzId) {
  return request({
    url: '/htbz/htbz/get/FileList/By/subId?sId=' + htbzId,
    method: 'get'
  })
}

// 获取合同编制与年度计划详细信息
export function selectHtglHtbzNdjhByHtbzId(htbzId) {
  return request({
    url: '/htbz/htbz/ndjh/' + htbzId,
    method: 'get'
  })
}

// 获取合同编制与预算经费详细信息
export function selectHtglHtbzYsJfByHtbzId(htbzId) {
  return request({
    url: '/htbz/htbz/ysjf/' + htbzId,
    method: 'get'
  })
}

// 获取合同编制与支付计划详细信息
export function selectHtglHtbzZfJhByHtbzId(htbzId) {
  return request({
    url: '/htbz/htbz/zfjh/' + htbzId,
    method: 'get'
  })
}

// 获取合同编制与课题承担人员详细信息
export function selectHtglHtbzCdRyByHtbzId(htbzId) {
  return request({
    url: '/htbz/htbz/cdry/' + htbzId,
    method: 'get'
  })
}

// 修改合同编制
export function updateHtbz(data) {
  return request({
    url: '/htbz/htbz',
    method: 'put',
    data: data
  })
}

// 删除合同编制
export function delHtbz(htbzId) {
  return request({
    url: '/htbz/htbz/' + htbzId,
    method: 'delete'
  })
}

// 获取合同编制主键ID
export function getHtBzId() {
  return request({
    url: '/htbz/htbz/getHtBzId',
    method: 'get'
  })
}

// 根据模板导出word
export function exportWord(query, htbzId) {
  return request({
    url: '/htbz/htbz/exportWord/' + htbzId,
    method: 'get',
    params: query
  })
}

// 删除合同附件
export function delHtFj(fjId) {
  return request({
    url: '/htbz/htbz/fj/' + fjId,
    method: 'delete'
  })
}
